import Inula, { Fragment, Component, useState, useEffect } from 'openinula';
import {getList} from './../http.js'
import {getStore} from './../store.js'
export const Home = ()=>{
  const store = getStore()
  const [count,setCount] = useState(1)

  const add = ()=>{
    setCount(count+1)
  }

  useEffect(()=>{
    console.log(store.data,'store.dataaaaa')
    console.log(store.loading,'store.loading')
    // 修改loading的值为 true
    store.setLoading(true)
    getList().then(res=>{
      console.log(res,'getListtttt')
    })
  },[])

  return <div>
      <div> count: { count }</div>
      <button onClick={add}>add</button>
    </div>
}